/*function set(name,cursel,n){
	  for(i=1;i<=n;i++){
	  var menu=document.getElementById(name+i);
	  var con=document.getElementById(name+"_"+i);
	  menu.className=i==cursel?"hcur":"";
	  con.style.display=i==cursel?"block":"none";
	} 
}*/
/* function showList(id,num){
	if(num == 1){
		document.getElementById(id).style.display = "block";
	}
	else{
		document.getElementById(id).style.display = "none";
	}
} 
var	set = function (name,cursel,n) { 

}*/
function set(name,cursel,n){
	//console.log("0");
	
	for(i=1;i<=n;i++){
		var menu=$('#'+name+i),
		   con=$('#'+name+'_'+i),
		   dis=i==cursel?"block":"none";
		//console.log(menu);
		menu.removeClass('hcur');
		menu.addClass(i== cursel?"hcur":"");
		con.css("display",dis);
		
		//console.log(menu.hasClass("hcur"));
		//console.log(con.css("display"));
	} 
}


/*function createDesktop(sUrl,sName){
	try{
		var fso = new ActiveXObject("Scripting.FileSystemObject");
		var shell = new ActiveXObject("WScript.Shell");
		var folderPath = shell.SpecialFolders("Desktop") ;//获取桌面本地桌面地址
		if(!fso.FolderExists(folderPath)){
			fso.CreateFolder(folderPath);
		}
		if(!fso.FileExists(folderPath + "//"+sName+".lnk")){
			//在指定的文件夹下创建名为sName的快捷方式
			var shortLink = shell.CreateShortcut(folderPath + "//"+sName+".lnk"); //相应的描述信息
			shortLink.Description = "shortcut for "+sName; //快捷方式指向的链接
			shortLink.TargetPath = sUrl; //激活链接并且窗口最大化
			shortLink.WindowStyle = 3;
			shortLink.Save();
			alert('成功');
		}
	}catch(e){
		alert("当前IE安全级别不允许操作！");
	}
}
function toDesktop(sUrl,sName){
	try  
	{
	var WshShell = new ActiveXObject("WScript.Shell");
	var oUrlLink = WshShell.CreateShortcut(WshShell.SpecialFolders("Desktop") + "\\" + sName + ".url");
	oUrlLink.TargetPath = sUrl;
	oUrlLink.Save();
	}  
	catch(e)  
	{  
	alert("当前浏览器安全级别不允许操作！");  
	}
}
*/

function createShortcutFile(title,URL){   
	var   fso,   ts;   
	var   ForWriting=   2;   
	fso   =   new   ActiveXObject("Scripting.FileSystemObject");   
	var   path= "C:\\Documents and Settings\\All Users\\桌面\\"+title+ ".url" ;  
	if(!fso.FileExists(path)){   
	ts   =   fso.OpenTextFile(path,   ForWriting,   true);   
	ts.WriteLine( "[DEFAULT] ");   
	ts.WriteLine( "BASEURL="+URL);   
	ts.WriteLine( "[InternetShortcut] ");   
	ts.WriteLine( "URL="+URL);   
	}   else{   
	alert( "快捷方式存在! ");   
	}   
} 

//设为首页
function SetHome(obj,url){
  try{
    obj.style.behavior='url(#default#homepage)';
    obj.setHomePage(url);
  }catch(e){
    if(window.netscape){
     try{
       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     }catch(e){
       alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
     }
    }else{
    alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将【"+url+"】设置为首页。");
    }
 }
}
  
//收藏本站
function AddFavorite(title, url) {
 try {
   window.external.addFavorite(url, title);
 }
catch (e) {
   try {
    window.sidebar.addPanel(title, url, "");
  }
   catch (e) {
     alert("抱歉，您所使用的浏览器无法完成此操作。\n\n加入收藏失败，请进入新网站后使用Ctrl+D进行添加");
   }
 }
}  